<h1 class="right">تقرير حركة الصندوق</h1>
<div class="clear"></div>

<div id="dashboard-container">
	<div class="customers-filter">
        	<form name="contract_search" action="" method="POST" id="searchClient">
      <table class="bookings-filter" >
         <tr>
            
            	<td style="width:20px;">من  </td>
                <td style="width:100px;">
                  <input type="text" class="small-input" name="from" id="from-0" placeholder=""  value="<?php if(isset($binds['from']) ) {echo $binds['from'];} ?>"/>
                </td>
                <td style="width:20px;">الى</td>
                <td style="width:100px;"><input type="text" class="small-input" name="to" id="to-0" placeholder="" value="<?php if(isset($binds['to']) ) {echo $binds['to'];} ?>" /></td>
               
                <input type="hidden" id="page" name="page" value="" />
				
               <td></td><td></td><td></td>
                <td style="width:50px">
                  <input type="hidden" name="filteration" value="5"/> <!-- 5 for Boxes Reposts -->
                  <a href="#"><div class="export-button">تصدير Excel</div></a>
                  
                  <input type="hidden" id="pdf_excel" name="pdf_excel" value="0"/>
                </td>
                <td style="width:50px"><a href="#"><div class="export-PDF">تصدير PDF</div></a></td>
                <td style="width:50px"><div class="search-botton">بحث</div></td>
                
            </tr>
            
      </table>
      </form>
    </div>
    
    
    <div class="dashboard-row">
    
    	<table class="customers-table">
        	<thead>
            
			<tr class="customers-table-head">
			  <td colspan="5">سندات الصرف</td>
			  <td></td>
			  <td colspan="5">سندات القبض</td>
      </tr>
      <tr class="customers-table-head">
	          <td width="">رقم العقد</td>
			  <td width="">رقم السند</td>
              <td width="">بتاريخ</td>
              <td width="">من اجل</td>
              <td width="">المبلغ</td>
			  <td width="70px"></td>
			  <td width="">رقم العقد</td>
			  <td width="">رقم السند</td>
              <td width="">بتاريخ</td>
              <td width="">من اجل</td>
              <td width="">المبلغ</td>
      </tr>
            </thead>
            <?php if(isset($boxes)) {  ?>
            <?php foreach($boxes as $box) {
			
			?>
             
                <tr class="">
				<td class="red"  width="">
                    <?php  if(isset($box['contract_id']))
                        echo $box['contract_id'];  ?>
                    </td>
                    <td class="blue"  width="">
                    <?php 
                      if(isset($box['payment_id']))
                        echo $box['payment_id']; 
                    ?>
                    </td>
                    <td  width="">
                    <?php 
                      if(isset($box['miladi_date']))
                        echo $box['miladi_date']; 
                    ?>
                    </td>
                    <td width="">
                    <?php 
                      if(isset($box['reason']))
                        echo $box['reason']; 
                    ?>
                    </td>
                    <td width="">
                    <?php
                      if(isset($box['amount']))
                        echo $box['amount']; 
                    ?>
                    </td>
				<td></td>
					
					<td class="red"  width="">
                    <?php echo $box['contract_id_r']; ?>
                    </td>
					<td class="blue"  width=""><?php echo $box['recipet_id']; ?></td>
                    <td width=""><?php echo $box['reciept_miladi_date']; ?></td>
                    <td width=""><?php echo $box['reciept_reason']; ?></td>
                    <td width=""><?php echo $box['reciept_amount']; ?></td>
                </tr>
             
            <?php  } }?>
			<tr class="red" >
			  <td colspan="5">إجمالى سندات الصرف فى هذه الفترة: <?php echo $total_sum_p ; ?></td>
			  <td></td>
			  <td colspan="5">إجمالى سندات القبض فى هذه الفترة: <?php echo $total_sum_r ; ?></td>
      </tr>
        </table>
		
		
		<br />
        <hr />
      
      <?php
	  
          $start = $page * 20 -19;
          $end  = $start + 19;
          if($end > $totalPages)
            $end = $totalPages;
        ?>
        <?php if(!empty($boxes)) { ?>
        <div class="clear"></div>
        <div class="relative">
          <div id="contracts-selection" class="center"></div>
          <span class="middle xsmall showing-results absolute">عرض النتائج <?php echo $start; ?> - <?php echo $end; ?> من إجمالى <?php echo $totalPages;?></span>
        </div> 

        <div class="hidden totalPages"><?php if(isset($totalPages)) {echo $totalPages;} ?></div>
        <div class="hidden currentPage"><?php if(isset($page)) {echo $page;} ?></div>
        <?php } ?>
    </div>
    <hr />
    
  <div class="clear"></div>
  </div>
</div>        
